import { createApp } from 'vue';
import ElementPlus from "element-plus";
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

import 'element-plus/dist/index.css';
import 'element-plus/theme-chalk/dark/css-vars.css';
import '@/styles/tailwindcss.css';

import App from './App.vue';
import { setupStore } from './stores';
import router from './router';

async function bootstrap() {
    const app = createApp(App);

    setupStore(app);

    app.use(router);
    app.use(ElementPlus, {
        locale: zhCn
    });

    // 全局注册el-icon
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
        app.component(key, component)
    }

    app.mount('#app');
}

bootstrap();